package org.example.types.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum ResponseCode {

    SUCCESS("0000", "成功"),
    UN_ERROR("0001", "未知失败"),
    ILLEGAL_PARAMETER("0002", "非法参数"),
    INDEX_EXCEPTION("0003", "唯一索引冲突"),
    UPDATE_ZERO("0004", "更新记录为0"),
    HTTP_EXCEPTION("0005", "HTTP接口调用异常"),
    LOGIN_FAIL("0006", "登录失败"),
    NO_PRODUCT("0007", "无对应商品信息"),
    CACHE_BUILD_ERROR("0008", "缓存构建异常"),
    DYNAMIC_CONFIG_REFLECTION_ERROR("0009", "动态配置反射异常"),
    DYNAMIC_CONFIG_INIT_ERROR("0010", "动态配置初始化异常"),
    DYNAMIC_CONFIG_UPDATE_ERROR("0011", "动态配置更新异常"),
    ORDER_LOCK_ERROR("0012", "下单失败"),

    ORDER_DB_INSERT_ERROR("1001", "订单数据库插入异常"),
    ORDER_DB_UPDATE_ERROR("1002", "订单数据库更新异常"),
    ORDER_DB_SELECT_ERROR("1003", "订单数据库查询异常"),

    TRANSACTION_OUTRECORD_DUPLICATION_ERROR("2001", "外部交易单重复提交"),
    TRANSACTION_DUPLICATE_PAYMENT_ERROR("2002", "外部交易单重复支付"),
    TRANSACTION_INORDER_MISSED_ERROR("2003", "内部订单缺失"),
    TRANSACTION_OUTRECORD_INSERT_ERROR("2004", "外部交易单插入异常"),

    TRANSACTION_REFUND_DUPLICATION_ERROR("3001", "对同一订单进行重复退款"),
    TRANSACTION_REFUND_OUTRECORD_UNPAID_ERROR("3002", "外部交易单未支付"),
    TRANSACTION_REFUND_UPDATE_ERROR("3003", "数据库退款状态更新异常"),
    ;

    private String code;
    private String info;
}
